package com.ktwlsoft.archivemanage.domain.business.repositoryService.study;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.repository.study.StudyHistoryMapper;
import lombok.Getter;
import org.springframework.stereotype.Service;

/**
 * 课程历史
 *
 * @author Name on 2019/12/25 11:43
 * @version 1.0
 */
@Service
public class StudyHistoryRepositoryService {

    /**课程历史*/
    @Getter
    private final StudyHistoryMapper studyHistoryMapper;

    public StudyHistoryRepositoryService(StudyHistoryMapper studyHistoryMapper) {
        this.studyHistoryMapper = studyHistoryMapper;
    }

    /**
      * 分页 on 2019/12/25 11:53
      *
      * @param jsonObject jsonObject
      * @return PageInfo<JSONObject>
      */
    public PageInfo<JSONObject> findPage(int pn,int pageSize,JSONObject jsonObject){
        PageHelper.startPage(pn,pageSize);
        return new PageInfo<>(studyHistoryMapper.findList(jsonObject));
    }
}